package org.example.platform.design.singleton;

/**
 * 单例模式
 */
public class Singletion {
    private static Singletion singletion;
    private Singletion(){
        // 构造方法私有化，防止外界利用new创建该类实例
    }

    public static Singletion getInstance(){
        if(singletion == null){
            singletion = new Singletion();
        }
        return singletion;
    }
}
